import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import p001 from './p001';

export default async function a001(fd: IFeidaoAiBrowserComponent, data: { plan: string; type: string; }, flag: string) {
	// todo
	console.log(data, 'zj6a1');
	const n = fd.data.node.querySelector<HTMLDivElement>('[data-id="account"]');
	set_node_cls(n, 'display-n', false);

	const res = await nodejs<Array<{}>>('plan-cb/zj-000006/s001', {
		plan_type_no: data.type,
		plan_cla_attr_no: data.plan,
		pn: 1,
		plan_list_name: ''
	});
	console.log(res);

	render(fd, res, p001, 'p001', 'inner');
	set(fd, 'data', data);
	set(fd, 'flag', flag);
}
